package cn.epsilon3.controller;

import cn.epsilon3.annotation.E3Log;
import cn.epsilon3.annotation.E3Service;
import cn.epsilon3.common.Result;
import cn.epsilon3.domain.e3.dto.ThirdAuthLoginDTO;
import cn.epsilon3.service.thirdAuthLogin.E3ThirdAuthLoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.annotation.Resource;
import javax.validation.Valid;

@Api(tags = "E3-三方单点登录-v1.1.4")
@E3Service(path = "/third/sso")
public class E3ThirdSSOLoginController {

    @Resource
    private E3ThirdAuthLoginService e3ThirdAuthLoginService;

    @PostMapping("/login.action")
    @E3Log
    @ApiOperation("三方登陆")
    public Result<Object> action(@Valid @RequestBody ThirdAuthLoginDTO aliThirdAuthLoginDTO) {
        return e3ThirdAuthLoginService.to(aliThirdAuthLoginDTO);
    }
}
